using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using MCMLXVII.BackEnd.Services.Common.Messages;
using MCMLXVII.BackEnd.Services.SystemConfiguration.Messages;
using MCMLXVII.Core.Common.BackEnd;
using MCMLXVII.Core.Common.BackEnd.ConfigurationClasses;
using MCMLXVII.BackEnd.Pipeline;
using System.ServiceModel;

namespace MCMLXVII.BackEnd.Services.Core.BusinessActions
{
    public class Actions
    {

        public msgActionInfo[] GetActionsList(msgGenericItemRequest<string> PartitionName)
        {
            //xmlSerializableGenericCollection<ActionConfig> cfg = PartitionsManager.GetActions(PartitionName.Item );
            //msgActionInfo[] res = new msgActionInfo[cfg.Count];
            //int i = 0;
            //foreach (DictionaryEntry de in cfg.GetItems())
            //{
            //    ActionConfig act = (ActionConfig)de.Value;
            //    StringNameAndValue[] inf = new StringNameAndValue[act.AditionalConfigInfo.GetItems().Count];
            //    int j= 0;
            //    foreach (DictionaryEntry de1 in act.AditionalConfigInfo.GetItems())
            //    {
            //        inf[j] = new StringNameAndValue(de1.Key.ToString(), de1.Value.ToString());
            //        j++;
            //    }

            //    res[i] = new msgActionInfo(act.Name, act.Pipeline, act.InternalPipeline, act.AsyncPipeline,
            //        act.EarlyBinding, act.Enabled, act.EntryPoint, act.IsCritical, act.PublishInTransport, act.TypeAndAssembly, inf);
            //    i++;
            //}
            //return res;
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));
            
        }

        public msgActionInfo GetActionInfo(msgPartitionItemRequest req)
        {
            //ActionConfig act = PartitionsManager.GetAction(req.PartitionName, req.ItemName);
            //StringNameAndValue[] inf = new StringNameAndValue[act.AditionalConfigInfo.GetItems().Count];
            //int j = 0;
            //foreach (DictionaryEntry de1 in act.AditionalConfigInfo.GetItems())
            //{
            //    inf[j] = new StringNameAndValue(de1.Key.ToString(), de1.Value.ToString());
            //    j++;
            //}
            //
            //return new msgActionInfo(act.Name, act.Pipeline, act.InternalPipeline, act.AsyncPipeline,
            //    act.EarlyBinding, act.Enabled, act.EntryPoint, act.IsCritical, act.PublishInTransport, act.TypeAndAssembly, inf);
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));
        }

        public string[] GetActionsAssemblies(msgGenericItemRequest<string> PartitionName)
        {
            //return PartitionsManager.GetActionAssemblies(PartitionName.Item);
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));
        }

        public string[] GetActionsAssembyTypes(msgPartitionItemRequest Partition)
        {
            //return PartitionsManager.GetActionAssemblyTypes(Partition.PartitionName, Partition.ItemName );
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));
        }

        public string[] GetActionsAssembyAndTypeMethods(msgPartitionItemAndSubItemRequest Partition)
        {
            //return PartitionsManager.GetActionAssemblyAndTypeMethods(Partition.PartitionName, Partition.ItemName, Partition.SubItemName);
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));
        }

    
    }
}
